import { defineStore } from "pinia";
import { labConsoleKey } from "../key";
import { LabConsoleApiModel } from "@/type/console/labConsole";
interface IBasicState {
  labConsoleState: LabConsoleApiModel

}

export const useLabStore = defineStore(labConsoleKey, {
  state(): IBasicState {
    return {
      labConsoleState: {
        pageTran: {
          enableTrans: false
        },
        statusBar: {
          enableHotNews: false,
          enableNewMessage: false,
          autoMessage: false
        },
        system: {
          tableWinAdv: false,
          autoHardAdv: false
        }
      }
    }
  }

  ,
  actions: {
    updateLabConsole(labConsole: LabConsoleApiModel) {
      this.labConsoleState = labConsole;
    }
  },
  getters: {

    getLabConsole(state) { return state.labConsoleState }

  },
  persist: {

    pick: ["labConsoleState"]
  },
});